package org.dxy.domain.event.material;

import org.dxy.domain.event.AggregateTypeEnum;
import org.dxy.domain.event.DomainEvent;

/**
 * 物料已创建事件
 * 新物料创建成功时触发
 * @author dxy
 * @createTime 2025/9/7
 */
public record MaterialCreatedEvent(
        /**
         * 物料ID
         */
        Long materialId,
        
        /**
         * 物料编码
         */
        String materialCode
) implements DomainEvent {
    
    @Override
    public Long aggregateId() {
        return materialId;
    }
    
    @Override
    public String aggregateType() {
        return AggregateTypeEnum.MATERIAL.getKey();
    }
    
    @Override
    public String eventType() {
        return MaterialEventTypeEnum.CREATED.getKey();
    }
}